<template>
  <div>
<el-dialog
  title="修改学生"
  :visible="dialogVisible"
  @update:visible='setDialogVisible'
  width="30%"
  >

  <el-form  label-width="80px">
  <el-form-item label="学生姓名:">
    <el-input v-model="stuBean.stuName"></el-input>
  </el-form-item>

</el-form>


  <span slot="footer" class="dialog-footer">
    <el-button @click="setDialogVisible(false)">取 消</el-button>
    <el-button type="primary" @click="updateStudent(stuBean.studentId)">修 改</el-button>
  </span>
</el-dialog>
  </div>
</template>

<script>
import{
    updateStu
} from  '../service/index'
import {mapActions, mapMutations, mapState } from 'vuex'
export default {
 

  computed: {
     ...mapState('student',['dialogVisible','stuBean'])
  },
  methods: {
    ...mapMutations('student',['setDialogVisible']),
        ...mapActions('student', ['showStu']),
    async updateStudent(id){
        
      await updateStu({id:id,powerUrl:this.powerBean.powerUrl});
       this.showStu();
       this.setDialogVisible(false);

     },
    
  }
}
</script>

<style>

</style>